package com.siam.package_rider.controller.rider;

import java.util.List;

import com.siam.package_rider.cache.RiderSessionManager;
import com.siam.package_rider.entity.TbRider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.siam.package_common.entity.BasicResult;

import com.siam.package_rider.entity.TbRiderWithdrawRecord;
import com.siam.package_rider.service.TbRiderWithdrawRecordService;
import com.siam.package_rider.model.param.TbRiderWithdrawRecordParam;

/**
 * ---------------------------
 * 骑手提现记录表 (TbRiderWithdrawRecordController)         
 * ---------------------------
 * 作者：  高品
 * 时间：  2025-03-29 18:55:18
 * ---------------------------
 */
@RestController
@RequestMapping("/rest/rider/withdrawRecord")
public class TbRiderWithdrawRecordController {

	@Autowired
	private TbRiderWithdrawRecordService tbRiderWithdrawRecordService;

	@Autowired
	private RiderSessionManager riderSessionManager;

    /**
     * 基础分页查询
     * @param param
     * @return
     */    
	@PostMapping(value="/page")
	public BasicResult page(@RequestBody TbRiderWithdrawRecordParam param) {
		TbRider loginRider = riderSessionManager.getSession(com.siam.package_user.util.TokenUtil.getToken());
		param.setRiderId(loginRider.getId());
		return BasicResult.success(tbRiderWithdrawRecordService.page(param));
	}
}
